package com.design.mode.composite;

import org.junit.jupiter.api.Test;

/**
 * @author 宫静雨
 * @version 1.0
 * @since 2023-04-08 10:21:46
 */
public class CompositeTest {

    @Test
    public void test1() {
        University university = new University("bb", "hello");

        College a = new College("a", "a");
        College b = new College("b", "b");

        a.add(new Department("a-1","aaa"));
        a.add(new Department("a-2","aaa"));
        a.add(new Department("a-3","aaa"));
        a.add(new Department("a-4","aaa"));

        b.add(new Department("b-1","bbb"));
        b.add(new Department("b-2","bbb"));
        b.add(new Department("b-3","bbb"));
        b.add(new Department("b-4","bbb"));

        university.add(a);
        university.add(b);

        university.print();
    }
}
